package org.simplextensions.ui.settings;

import org.eclipse.swt.SWT;
import org.eclipse.swt.widgets.Display;
import org.simplextensions.annotations.ioc.Registry;
import org.simplextensions.registry.IExtensionRegistry;
import org.simplextensions.ui.menu.ApplicationMenu;
import org.simplextensions.ui.menu.INoContextAction;
import org.simplextensions.ui.menu.MenuExtensionAdapter;
import org.simplextensions.ui.menu.MenuExtensionMetadata;
import org.simplextensions.ui.menu.annotations.Action;

@Action(id = "ShowSettingsAction", parent = ApplicationMenu.WindowMenu)
public class ShowSettingsAction extends MenuExtensionAdapter implements INoContextAction {

	@Registry
	protected IExtensionRegistry extensionRegistry;

	public void run(MenuExtensionMetadata metadata) {
		new SettingsDialog(extensionRegistry, Display.getDefault().getActiveShell(), SWT.NORMAL).open();
	}

}
